package com.example.myworkers.service.imp;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.myworkers.dao.EmpBreakMapper;
import com.example.myworkers.dao.EmpCancelMapper;
import com.example.myworkers.dao.EmpOutworkMapper;
import com.example.myworkers.model.EmpCancel;
import com.example.myworkers.service.EmpBreakService;
import com.example.myworkers.service.EmpCancelService;
import com.example.myworkers.service.EmpOutworkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *Author：吴秋霞
 */
@Service
public class EmpCancelServiceImpl extends ServiceImpl<EmpCancelMapper, EmpCancel>
        implements EmpCancelService{

    @Autowired
    private EmpOutworkMapper empOutworkMapper;

    @Autowired
    private EmpBreakMapper empBreakMapper;

    @Override
    public String addEmpCancel(EmpCancel empCancel) {
        Date date = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        empCancel.setCreatetime(dateFormat.format(date));

//        if ("请假".equals(empCancel.getCanceltype())) {
//
//        }
        save(empCancel);
        return "销假申请成功";
    }
}




